<?php
	/**
	 * The abstract TableProjectReviewByBuyerGen class defined here is
	 * code-generated and contains all the basic CRUD-type functionality as well as
	 * basic methods to handle relationships and index-based loading.
	 *
	 * To use, you should use the TableProjectReviewByBuyer subclass which
	 * extends this TableProjectReviewByBuyerGen class.
	 *
	 * Because subsequent re-code generations will overwrite any changes to this
	 * file, you should leave this file unaltered to prevent yourself from losing
	 * any information or code changes.  All customizations should be done by
	 * overriding existing or implementing new methods, properties and variables
	 * in the TableProjectReviewByBuyer class.
	 * 
	 * @package My Application
	 * @subpackage GeneratedDataObjects
	 * @property-read integer $Id the value for intId (Read-Only PK)
	 * @property integer $ProjectId the value for intProjectId (Not Null)
	 * @property integer $BuyerId the value for intBuyerId (Not Null)
	 * @property integer $ProviderId the value for intProviderId (Not Null)
	 * @property integer $Rate1 the value for intRate1 
	 * @property integer $Rate2 the value for intRate2 
	 * @property integer $Rate3 the value for intRate3 
	 * @property integer $Rate4 the value for intRate4 
	 * @property integer $Rate5 the value for intRate5 
	 * @property integer $Rate6 the value for intRate6 
	 * @property double $RateAverage the value for fltRateAverage 
	 * @property string $Comment the value for strComment 
	 * @property QDateTime $ReviewDate the value for dttReviewDate 
	 * @property QDateTime $UpdateDate the value for dttUpdateDate 
	 * @property integer $UpdateCount the value for intUpdateCount (Not Null)
	 * @property integer $Type the value for intType (Not Null)
	 * @property integer $Status the value for intStatus (Not Null)
	 * @property string $Active the value for strActive (Not Null)
	 * @property TableProject $Project the value for the TableProject object referenced by intProjectId (Not Null)
	 * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new)
	 */
	class TableProjectReviewByBuyerGen extends QBaseClass {

		///////////////////////////////////////////////////////////////////////
		// PROTECTED MEMBER VARIABLES and TEXT FIELD MAXLENGTHS (if applicable)
		///////////////////////////////////////////////////////////////////////
		
		/**
		 * Protected member variable that maps to the database PK Identity column table_project_review_by_buyer.id
		 * @var integer intId
		 */
		protected $intId;
		const IdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.project_id
		 * @var integer intProjectId
		 */
		protected $intProjectId;
		const ProjectIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.buyer_id
		 * @var integer intBuyerId
		 */
		protected $intBuyerId;
		const BuyerIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.provider_id
		 * @var integer intProviderId
		 */
		protected $intProviderId;
		const ProviderIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate1
		 * @var integer intRate1
		 */
		protected $intRate1;
		const Rate1Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate2
		 * @var integer intRate2
		 */
		protected $intRate2;
		const Rate2Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate3
		 * @var integer intRate3
		 */
		protected $intRate3;
		const Rate3Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate4
		 * @var integer intRate4
		 */
		protected $intRate4;
		const Rate4Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate5
		 * @var integer intRate5
		 */
		protected $intRate5;
		const Rate5Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate6
		 * @var integer intRate6
		 */
		protected $intRate6;
		const Rate6Default = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.rate_average
		 * @var double fltRateAverage
		 */
		protected $fltRateAverage;
		const RateAverageDefault = 0.00;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.comment
		 * @var string strComment
		 */
		protected $strComment;
		const CommentDefault = null;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.review_date
		 * @var QDateTime dttReviewDate
		 */
		protected $dttReviewDate;
		const ReviewDateDefault = null;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.update_date
		 * @var QDateTime dttUpdateDate
		 */
		protected $dttUpdateDate;
		const UpdateDateDefault = null;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.update_count
		 * @var integer intUpdateCount
		 */
		protected $intUpdateCount;
		const UpdateCountDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.type
		 * @var integer intType
		 */
		protected $intType;
		const TypeDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.status
		 * @var integer intStatus
		 */
		protected $intStatus;
		const StatusDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_project_review_by_buyer.active
		 * @var string strActive
		 */
		protected $strActive;
		const ActiveMaxLength = 1;
		const ActiveDefault = null;


		/**
		 * Protected array of virtual attributes for this object (e.g. extra/other calculated and/or non-object bound
		 * columns from the run-time database query result for this object).  Used by InstantiateDbRow and
		 * GetVirtualAttribute.
		 * @var string[] $__strVirtualAttributeArray
		 */
		protected $__strVirtualAttributeArray = array();

		/**
		 * Protected internal member variable that specifies whether or not this object is Restored from the database.
		 * Used by Save() to determine if Save() should perform a db UPDATE or INSERT.
		 * @var bool __blnRestored;
		 */
		protected $__blnRestored;




		///////////////////////////////
		// PROTECTED MEMBER OBJECTS
		///////////////////////////////

		/**
		 * Protected member variable that contains the object pointed by the reference
		 * in the database column table_project_review_by_buyer.project_id.
		 *
		 * NOTE: Always use the Project property getter to correctly retrieve this TableProject object.
		 * (Because this class implements late binding, this variable reference MAY be null.)
		 * @var TableProject objProject
		 */
		protected $objProject;





		///////////////////////////////
		// CLASS-WIDE LOAD AND COUNT METHODS
		///////////////////////////////

		/**
		 * Static method to retrieve the Database object that owns this class.
		 * @return QDatabaseBase reference to the Database object that can query this class
		 */
		public static function GetDatabase() {
			return QApplication::$Database[1];
		}

		/**
		 * Load a TableProjectReviewByBuyer from PK Info
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer
		 */
		public static function Load($intId, $objOptionalClauses = null) {
			// Use QuerySingle to Perform the Query
			return TableProjectReviewByBuyer::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Id, $intId)
				),
				$objOptionalClauses
			);
		}

		/**
		 * Load all TableProjectReviewByBuyers
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		 */
		public static function LoadAll($objOptionalClauses = null) {
			if (func_num_args() > 1) {
				throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
			}
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadAll query
			try {
				return TableProjectReviewByBuyer::QueryArray(QQ::All(), $objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count all TableProjectReviewByBuyers
		 * @return int
		 */
		public static function CountAll() {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountAll query
			return TableProjectReviewByBuyer::QueryCount(QQ::All());
		}




		///////////////////////////////
		// QCUBED QUERY-RELATED METHODS
		///////////////////////////////

		/**
		 * Internally called method to assist with calling Qcubed Query for this class
		 * on load methods.
		 * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause object or array of QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
		 * @param boolean $blnCountOnly only select a rowcount
		 * @return string the query statement
		 */
		protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {
			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();

			// Create/Build out the QueryBuilder object with TableProjectReviewByBuyer-specific SELET and FROM fields
			$objQueryBuilder = new QQueryBuilder($objDatabase, 'table_project_review_by_buyer');
			TableProjectReviewByBuyer::GetSelectFields($objQueryBuilder);
			$objQueryBuilder->AddFromItem('table_project_review_by_buyer');

			// Set "CountOnly" option (if applicable)
			if ($blnCountOnly)
				$objQueryBuilder->SetCountOnlyFlag();

			// Apply Any Conditions
			if ($objConditions)
				try {
					$objConditions->UpdateQueryBuilder($objQueryBuilder);
				} catch (QCallerException $objExc) {
					$objExc->IncrementOffset();
					throw $objExc;
				}

			// Iterate through all the Optional Clauses (if any) and perform accordingly
			if ($objOptionalClauses) {
				if ($objOptionalClauses instanceof QQClause)
					$objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
				else if (is_array($objOptionalClauses))
					foreach ($objOptionalClauses as $objClause)
						$objClause->UpdateQueryBuilder($objQueryBuilder);
				else
					throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
			}

			// Get the SQL Statement
			$strQuery = $objQueryBuilder->GetStatement();

			// Prepare the Statement with the Query Parameters (if applicable)
			if ($mixParameterArray) {
				if (is_array($mixParameterArray)) {
					if (count($mixParameterArray))
						$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);

					// Ensure that there are no other Unresolved Named Parameters
					if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)
						throw new QCallerException('Unresolved named parameters in the query');
				} else
					throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
			}

			// Return the Objects
			return $strQuery;
		}

		/**
		 * Static Qcubed Query method to query for a single TableProjectReviewByBuyer object.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return TableProjectReviewByBuyer the queried object
		 */
		public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TableProjectReviewByBuyer::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
			
			// Perform the Query, Get the First Row, and Instantiate a new TableProjectReviewByBuyer object
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			
			// Do we have to expand anything?
			if ($objQueryBuilder->ExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = TableProjectReviewByBuyer::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
					if ($objItem)
						$objToReturn[] = $objItem;					
				}			
				// Since we only want the object to return, lets return the object and not the array.
				return $objToReturn[0];
			} else {
				// No expands just return the first row
				$objToReturn = null;
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn = TableProjectReviewByBuyer::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
			}
			
			return $objToReturn;
		}

		/**
		 * Static Qcubed Query method to query for an array of TableProjectReviewByBuyer objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return TableProjectReviewByBuyer[] the queried objects as an array
		 */
		public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TableProjectReviewByBuyer::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and Instantiate the Array Result
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			return TableProjectReviewByBuyer::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
		}

		/**
		 * Static Qcubed Query method to query for a count of TableProjectReviewByBuyer objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return integer the count of queried objects as an integer
		 */
		public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TableProjectReviewByBuyer::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and return the row_count
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);

			// Figure out if the query is using GroupBy
			$blnGrouped = false;

			if ($objOptionalClauses) foreach ($objOptionalClauses as $objClause) {
				if ($objClause instanceof QQGroupBy) {
					$blnGrouped = true;
					break;
				}
			}

			if ($blnGrouped)
				// Groups in this query - return the count of Groups (which is the count of all rows)
				return $objDbResult->CountRows();
			else {
				// No Groups - return the sql-calculated count(*) value
				$strDbRow = $objDbResult->FetchRow();
				return QType::Cast($strDbRow[0], QType::Integer);
			}
		}

		public static function QueryArrayCached(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();

			$strQuery = TableProjectReviewByBuyer::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			
			$objCache = new QCache('qquery/tableprojectreviewbybuyer', $strQuery);
			$cacheData = $objCache->GetData();
			
			if (!$cacheData || $blnForceUpdate) {
				$objDbResult = $objQueryBuilder->Database->Query($strQuery);
				$arrResult = TableProjectReviewByBuyer::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
				$objCache->SaveData(serialize($arrResult));
			} else {
				$arrResult = unserialize($cacheData);
			}
			
			return $arrResult;
		}

		/**
		 * Updates a QQueryBuilder with the SELECT fields for this TableProjectReviewByBuyer
		 * @param QQueryBuilder $objBuilder the Query Builder object to update
		 * @param string $strPrefix optional prefix to add to the SELECT fields
		 */
		public static function GetSelectFields(QQueryBuilder $objBuilder, $strPrefix = null) {
			if ($strPrefix) {
				$strTableName = $strPrefix;
				$strAliasPrefix = $strPrefix . '__';
			} else {
				$strTableName = 'table_project_review_by_buyer';
				$strAliasPrefix = '';
			}

			$objBuilder->AddSelectItem($strTableName, 'id', $strAliasPrefix . 'id');
			$objBuilder->AddSelectItem($strTableName, 'project_id', $strAliasPrefix . 'project_id');
			$objBuilder->AddSelectItem($strTableName, 'buyer_id', $strAliasPrefix . 'buyer_id');
			$objBuilder->AddSelectItem($strTableName, 'provider_id', $strAliasPrefix . 'provider_id');
			$objBuilder->AddSelectItem($strTableName, 'rate1', $strAliasPrefix . 'rate1');
			$objBuilder->AddSelectItem($strTableName, 'rate2', $strAliasPrefix . 'rate2');
			$objBuilder->AddSelectItem($strTableName, 'rate3', $strAliasPrefix . 'rate3');
			$objBuilder->AddSelectItem($strTableName, 'rate4', $strAliasPrefix . 'rate4');
			$objBuilder->AddSelectItem($strTableName, 'rate5', $strAliasPrefix . 'rate5');
			$objBuilder->AddSelectItem($strTableName, 'rate6', $strAliasPrefix . 'rate6');
			$objBuilder->AddSelectItem($strTableName, 'rate_average', $strAliasPrefix . 'rate_average');
			$objBuilder->AddSelectItem($strTableName, 'comment', $strAliasPrefix . 'comment');
			$objBuilder->AddSelectItem($strTableName, 'review_date', $strAliasPrefix . 'review_date');
			$objBuilder->AddSelectItem($strTableName, 'update_date', $strAliasPrefix . 'update_date');
			$objBuilder->AddSelectItem($strTableName, 'update_count', $strAliasPrefix . 'update_count');
			$objBuilder->AddSelectItem($strTableName, 'type', $strAliasPrefix . 'type');
			$objBuilder->AddSelectItem($strTableName, 'status', $strAliasPrefix . 'status');
			$objBuilder->AddSelectItem($strTableName, 'active', $strAliasPrefix . 'active');
		}



		///////////////////////////////
		// INSTANTIATION-RELATED METHODS
		///////////////////////////////

		/**
		 * Instantiate a TableProjectReviewByBuyer from a Database Row.
		 * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
		 * is calling this TableProjectReviewByBuyer::InstantiateDbRow in order to perform
		 * early binding on referenced objects.
		 * @param DatabaseRowBase $objDbRow
		 * @param string $strAliasPrefix
		 * @param string $strExpandAsArrayNodes
		 * @param QBaseClass $arrPreviousItem
		 * @param string[] $strColumnAliasArray
		 * @return TableProjectReviewByBuyer
		*/
		public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array()) {
			// If blank row, return null
			if (!$objDbRow) {
				return null;
			}

			// Create a new instance of the TableProjectReviewByBuyer object
			$objToReturn = new TableProjectReviewByBuyer();
			$objToReturn->__blnRestored = true;

			$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
			$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'project_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'project_id'] : $strAliasPrefix . 'project_id';
			$objToReturn->intProjectId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'buyer_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'buyer_id'] : $strAliasPrefix . 'buyer_id';
			$objToReturn->intBuyerId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'provider_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'provider_id'] : $strAliasPrefix . 'provider_id';
			$objToReturn->intProviderId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate1', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate1'] : $strAliasPrefix . 'rate1';
			$objToReturn->intRate1 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate2', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate2'] : $strAliasPrefix . 'rate2';
			$objToReturn->intRate2 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate3', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate3'] : $strAliasPrefix . 'rate3';
			$objToReturn->intRate3 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate4', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate4'] : $strAliasPrefix . 'rate4';
			$objToReturn->intRate4 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate5', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate5'] : $strAliasPrefix . 'rate5';
			$objToReturn->intRate5 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate6', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate6'] : $strAliasPrefix . 'rate6';
			$objToReturn->intRate6 = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'rate_average', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'rate_average'] : $strAliasPrefix . 'rate_average';
			$objToReturn->fltRateAverage = $objDbRow->GetColumn($strAliasName, 'Float');
			$strAliasName = array_key_exists($strAliasPrefix . 'comment', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'comment'] : $strAliasPrefix . 'comment';
			$objToReturn->strComment = $objDbRow->GetColumn($strAliasName, 'Blob');
			$strAliasName = array_key_exists($strAliasPrefix . 'review_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'review_date'] : $strAliasPrefix . 'review_date';
			$objToReturn->dttReviewDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
			$strAliasName = array_key_exists($strAliasPrefix . 'update_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'update_date'] : $strAliasPrefix . 'update_date';
			$objToReturn->dttUpdateDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
			$strAliasName = array_key_exists($strAliasPrefix . 'update_count', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'update_count'] : $strAliasPrefix . 'update_count';
			$objToReturn->intUpdateCount = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'type', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'type'] : $strAliasPrefix . 'type';
			$objToReturn->intType = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'status', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'status'] : $strAliasPrefix . 'status';
			$objToReturn->intStatus = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'active', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active'] : $strAliasPrefix . 'active';
			$objToReturn->strActive = $objDbRow->GetColumn($strAliasName, 'VarChar');

			if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
				foreach ($arrPreviousItems as $objPreviousItem) {
					if ($objToReturn->Id != $objPreviousItem->Id) {
						continue;
					}

					// complete match - all primary key columns are the same
					return null;
				}
			}

			// Instantiate Virtual Attributes
			foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
				$strVirtualPrefix = $strAliasPrefix . '__';
				$strVirtualPrefixLength = strlen($strVirtualPrefix);
				if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
					$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
			}

			// Prepare to Check for Early/Virtual Binding
			if (!$strAliasPrefix)
				$strAliasPrefix = 'table_project_review_by_buyer__';

			// Check for Project Early Binding
			$strAlias = $strAliasPrefix . 'project_id__id';
			$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
			if (!is_null($objDbRow->GetColumn($strAliasName)))
				$objToReturn->objProject = TableProject::InstantiateDbRow($objDbRow, $strAliasPrefix . 'project_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);




			return $objToReturn;
		}

		/**
		 * Instantiate an array of TableProjectReviewByBuyers from a Database Result
		 * @param DatabaseResultBase $objDbResult
		 * @param string $strExpandAsArrayNodes
		 * @param string[] $strColumnAliasArray
		 * @return TableProjectReviewByBuyer[]
		 */
		public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null, $strColumnAliasArray = null) {
			$objToReturn = array();
			
			if (!$strColumnAliasArray)
				$strColumnAliasArray = array();

			// If blank resultset, then return empty array
			if (!$objDbResult)
				return $objToReturn;

			// Load up the return array with each row
			if ($strExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = TableProjectReviewByBuyer::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objToReturn, $strColumnAliasArray);
					if ($objItem) {
						$objToReturn[] = $objItem;
					}
				}
			} else {
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn[] = TableProjectReviewByBuyer::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);
			}

			return $objToReturn;
		}



		///////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Single Load and Array)
		///////////////////////////////////////////////////
			
		/**
		 * Load a single TableProjectReviewByBuyer object,
		 * by Id Index(es)
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer
		*/
		public static function LoadById($intId, $objOptionalClauses = null) {
			return TableProjectReviewByBuyer::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Id, $intId)
				),
				$objOptionalClauses
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by ProjectId Index(es)
		 * @param integer $intProjectId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByProjectId($intProjectId, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByProjectId query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->ProjectId, $intProjectId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by ProjectId Index(es)
		 * @param integer $intProjectId
		 * @return int
		*/
		public static function CountByProjectId($intProjectId) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByProjectId query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->ProjectId, $intProjectId)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by BuyerId Index(es)
		 * @param integer $intBuyerId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByBuyerId($intBuyerId, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByBuyerId query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->BuyerId, $intBuyerId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by BuyerId Index(es)
		 * @param integer $intBuyerId
		 * @return int
		*/
		public static function CountByBuyerId($intBuyerId) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByBuyerId query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->BuyerId, $intBuyerId)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by ProviderId Index(es)
		 * @param integer $intProviderId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByProviderId($intProviderId, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByProviderId query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->ProviderId, $intProviderId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by ProviderId Index(es)
		 * @param integer $intProviderId
		 * @return int
		*/
		public static function CountByProviderId($intProviderId) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByProviderId query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->ProviderId, $intProviderId)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate1 Index(es)
		 * @param integer $intRate1
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate1($intRate1, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate1 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate1, $intRate1),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate1 Index(es)
		 * @param integer $intRate1
		 * @return int
		*/
		public static function CountByRate1($intRate1) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate1 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate1, $intRate1)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate2 Index(es)
		 * @param integer $intRate2
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate2($intRate2, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate2 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate2, $intRate2),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate2 Index(es)
		 * @param integer $intRate2
		 * @return int
		*/
		public static function CountByRate2($intRate2) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate2 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate2, $intRate2)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate3 Index(es)
		 * @param integer $intRate3
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate3($intRate3, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate3 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate3, $intRate3),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate3 Index(es)
		 * @param integer $intRate3
		 * @return int
		*/
		public static function CountByRate3($intRate3) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate3 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate3, $intRate3)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate4 Index(es)
		 * @param integer $intRate4
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate4($intRate4, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate4 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate4, $intRate4),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate4 Index(es)
		 * @param integer $intRate4
		 * @return int
		*/
		public static function CountByRate4($intRate4) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate4 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate4, $intRate4)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate5 Index(es)
		 * @param integer $intRate5
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate5($intRate5, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate5 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate5, $intRate5),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate5 Index(es)
		 * @param integer $intRate5
		 * @return int
		*/
		public static function CountByRate5($intRate5) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate5 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate5, $intRate5)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Rate6 Index(es)
		 * @param integer $intRate6
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRate6($intRate6, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRate6 query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate6, $intRate6),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Rate6 Index(es)
		 * @param integer $intRate6
		 * @return int
		*/
		public static function CountByRate6($intRate6) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRate6 query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Rate6, $intRate6)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by RateAverage Index(es)
		 * @param double $fltRateAverage
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByRateAverage($fltRateAverage, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByRateAverage query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->RateAverage, $fltRateAverage),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by RateAverage Index(es)
		 * @param double $fltRateAverage
		 * @return int
		*/
		public static function CountByRateAverage($fltRateAverage) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByRateAverage query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->RateAverage, $fltRateAverage)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by ReviewDate Index(es)
		 * @param QDateTime $dttReviewDate
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByReviewDate($dttReviewDate, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByReviewDate query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->ReviewDate, $dttReviewDate),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by ReviewDate Index(es)
		 * @param QDateTime $dttReviewDate
		 * @return int
		*/
		public static function CountByReviewDate($dttReviewDate) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByReviewDate query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->ReviewDate, $dttReviewDate)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by UpdateDate Index(es)
		 * @param QDateTime $dttUpdateDate
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByUpdateDate($dttUpdateDate, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByUpdateDate query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->UpdateDate, $dttUpdateDate),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by UpdateDate Index(es)
		 * @param QDateTime $dttUpdateDate
		 * @return int
		*/
		public static function CountByUpdateDate($dttUpdateDate) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByUpdateDate query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->UpdateDate, $dttUpdateDate)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by UpdateCount Index(es)
		 * @param integer $intUpdateCount
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByUpdateCount($intUpdateCount, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByUpdateCount query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->UpdateCount, $intUpdateCount),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by UpdateCount Index(es)
		 * @param integer $intUpdateCount
		 * @return int
		*/
		public static function CountByUpdateCount($intUpdateCount) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByUpdateCount query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->UpdateCount, $intUpdateCount)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Type Index(es)
		 * @param integer $intType
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByType($intType, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByType query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Type, $intType),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Type Index(es)
		 * @param integer $intType
		 * @return int
		*/
		public static function CountByType($intType) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByType query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Type, $intType)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Status Index(es)
		 * @param integer $intStatus
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByStatus($intStatus, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByStatus query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Status, $intStatus),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Status Index(es)
		 * @param integer $intStatus
		 * @return int
		*/
		public static function CountByStatus($intStatus) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByStatus query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Status, $intStatus)
			);
		}
			
		/**
		 * Load an array of TableProjectReviewByBuyer objects,
		 * by Active Index(es)
		 * @param string $strActive
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TableProjectReviewByBuyer[]
		*/
		public static function LoadArrayByActive($strActive, $objOptionalClauses = null) {
			// Call TableProjectReviewByBuyer::QueryArray to perform the LoadArrayByActive query
			try {
				return TableProjectReviewByBuyer::QueryArray(
					QQ::Equal(QQN::TableProjectReviewByBuyer()->Active, $strActive),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TableProjectReviewByBuyers
		 * by Active Index(es)
		 * @param string $strActive
		 * @return int
		*/
		public static function CountByActive($strActive) {
			// Call TableProjectReviewByBuyer::QueryCount to perform the CountByActive query
			return TableProjectReviewByBuyer::QueryCount(
				QQ::Equal(QQN::TableProjectReviewByBuyer()->Active, $strActive)
			);
		}



		////////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Array via Many to Many)
		////////////////////////////////////////////////////




		//////////////////////////
		// SAVE, DELETE AND RELOAD
		//////////////////////////

		/**
		 * Save this TableProjectReviewByBuyer
		 * @param bool $blnForceInsert
		 * @param bool $blnForceUpdate
		 * @return int
		 */
		public function Save($blnForceInsert = false, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();

			$mixToReturn = null;

			try {
				if ((!$this->__blnRestored) || ($blnForceInsert)) {
					// Perform an INSERT query
					$objDatabase->NonQuery('
						INSERT INTO `table_project_review_by_buyer` (
							`project_id`,
							`buyer_id`,
							`provider_id`,
							`rate1`,
							`rate2`,
							`rate3`,
							`rate4`,
							`rate5`,
							`rate6`,
							`rate_average`,
							`comment`,
							`review_date`,
							`update_date`,
							`update_count`,
							`type`,
							`status`,
							`active`
						) VALUES (
							' . $objDatabase->SqlVariable($this->intProjectId) . ',
							' . $objDatabase->SqlVariable($this->intBuyerId) . ',
							' . $objDatabase->SqlVariable($this->intProviderId) . ',
							' . $objDatabase->SqlVariable($this->intRate1) . ',
							' . $objDatabase->SqlVariable($this->intRate2) . ',
							' . $objDatabase->SqlVariable($this->intRate3) . ',
							' . $objDatabase->SqlVariable($this->intRate4) . ',
							' . $objDatabase->SqlVariable($this->intRate5) . ',
							' . $objDatabase->SqlVariable($this->intRate6) . ',
							' . $objDatabase->SqlVariable($this->fltRateAverage) . ',
							' . $objDatabase->SqlVariable($this->strComment) . ',
							' . $objDatabase->SqlVariable($this->dttReviewDate) . ',
							' . $objDatabase->SqlVariable($this->dttUpdateDate) . ',
							' . $objDatabase->SqlVariable($this->intUpdateCount) . ',
							' . $objDatabase->SqlVariable($this->intType) . ',
							' . $objDatabase->SqlVariable($this->intStatus) . ',
							' . $objDatabase->SqlVariable($this->strActive) . '
						)
					');

					// Update Identity column and return its value
					$mixToReturn = $this->intId = $objDatabase->InsertId('table_project_review_by_buyer', 'id');
				} else {
					// Perform an UPDATE query

					// First checking for Optimistic Locking constraints (if applicable)

					// Perform the UPDATE query
					$objDatabase->NonQuery('
						UPDATE
							`table_project_review_by_buyer`
						SET
							`project_id` = ' . $objDatabase->SqlVariable($this->intProjectId) . ',
							`buyer_id` = ' . $objDatabase->SqlVariable($this->intBuyerId) . ',
							`provider_id` = ' . $objDatabase->SqlVariable($this->intProviderId) . ',
							`rate1` = ' . $objDatabase->SqlVariable($this->intRate1) . ',
							`rate2` = ' . $objDatabase->SqlVariable($this->intRate2) . ',
							`rate3` = ' . $objDatabase->SqlVariable($this->intRate3) . ',
							`rate4` = ' . $objDatabase->SqlVariable($this->intRate4) . ',
							`rate5` = ' . $objDatabase->SqlVariable($this->intRate5) . ',
							`rate6` = ' . $objDatabase->SqlVariable($this->intRate6) . ',
							`rate_average` = ' . $objDatabase->SqlVariable($this->fltRateAverage) . ',
							`comment` = ' . $objDatabase->SqlVariable($this->strComment) . ',
							`review_date` = ' . $objDatabase->SqlVariable($this->dttReviewDate) . ',
							`update_date` = ' . $objDatabase->SqlVariable($this->dttUpdateDate) . ',
							`update_count` = ' . $objDatabase->SqlVariable($this->intUpdateCount) . ',
							`type` = ' . $objDatabase->SqlVariable($this->intType) . ',
							`status` = ' . $objDatabase->SqlVariable($this->intStatus) . ',
							`active` = ' . $objDatabase->SqlVariable($this->strActive) . '
						WHERE
							`id` = ' . $objDatabase->SqlVariable($this->intId) . '
					');
				}

			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Update __blnRestored and any Non-Identity PK Columns (if applicable)
			$this->__blnRestored = true;


			// Return 
			return $mixToReturn;
		}

		/**
		 * Delete this TableProjectReviewByBuyer
		 * @return void
		 */
		public function Delete() {
			if ((is_null($this->intId)))
				throw new QUndefinedPrimaryKeyException('Cannot delete this TableProjectReviewByBuyer with an unset primary key.');

			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();


			// Perform the SQL Query
			$objDatabase->NonQuery('
				DELETE FROM
					`table_project_review_by_buyer`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($this->intId) . '');
		}

		/**
		 * Delete all TableProjectReviewByBuyers
		 * @return void
		 */
		public static function DeleteAll() {
			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				DELETE FROM
					`table_project_review_by_buyer`');
		}

		/**
		 * Truncate table_project_review_by_buyer table
		 * @return void
		 */
		public static function Truncate() {
			// Get the Database Object for this Class
			$objDatabase = TableProjectReviewByBuyer::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				TRUNCATE `table_project_review_by_buyer`');
		}

		/**
		 * Reload this TableProjectReviewByBuyer from the database.
		 * @return void
		 */
		public function Reload() {
			// Make sure we are actually Restored from the database
			if (!$this->__blnRestored)
				throw new QCallerException('Cannot call Reload() on a new, unsaved TableProjectReviewByBuyer object.');

			// Reload the Object
			$objReloaded = TableProjectReviewByBuyer::Load($this->intId);

			// Update $this's local variables to match
			$this->ProjectId = $objReloaded->ProjectId;
			$this->intBuyerId = $objReloaded->intBuyerId;
			$this->intProviderId = $objReloaded->intProviderId;
			$this->intRate1 = $objReloaded->intRate1;
			$this->intRate2 = $objReloaded->intRate2;
			$this->intRate3 = $objReloaded->intRate3;
			$this->intRate4 = $objReloaded->intRate4;
			$this->intRate5 = $objReloaded->intRate5;
			$this->intRate6 = $objReloaded->intRate6;
			$this->fltRateAverage = $objReloaded->fltRateAverage;
			$this->strComment = $objReloaded->strComment;
			$this->dttReviewDate = $objReloaded->dttReviewDate;
			$this->dttUpdateDate = $objReloaded->dttUpdateDate;
			$this->intUpdateCount = $objReloaded->intUpdateCount;
			$this->intType = $objReloaded->intType;
			$this->intStatus = $objReloaded->intStatus;
			$this->strActive = $objReloaded->strActive;
		}



		////////////////////
		// PUBLIC OVERRIDERS
		////////////////////

				/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Id':
					/**
					 * Gets the value for intId (Read-Only PK)
					 * @return integer
					 */
					return $this->intId;

				case 'ProjectId':
					/**
					 * Gets the value for intProjectId (Not Null)
					 * @return integer
					 */
					return $this->intProjectId;

				case 'BuyerId':
					/**
					 * Gets the value for intBuyerId (Not Null)
					 * @return integer
					 */
					return $this->intBuyerId;

				case 'ProviderId':
					/**
					 * Gets the value for intProviderId (Not Null)
					 * @return integer
					 */
					return $this->intProviderId;

				case 'Rate1':
					/**
					 * Gets the value for intRate1 
					 * @return integer
					 */
					return $this->intRate1;

				case 'Rate2':
					/**
					 * Gets the value for intRate2 
					 * @return integer
					 */
					return $this->intRate2;

				case 'Rate3':
					/**
					 * Gets the value for intRate3 
					 * @return integer
					 */
					return $this->intRate3;

				case 'Rate4':
					/**
					 * Gets the value for intRate4 
					 * @return integer
					 */
					return $this->intRate4;

				case 'Rate5':
					/**
					 * Gets the value for intRate5 
					 * @return integer
					 */
					return $this->intRate5;

				case 'Rate6':
					/**
					 * Gets the value for intRate6 
					 * @return integer
					 */
					return $this->intRate6;

				case 'RateAverage':
					/**
					 * Gets the value for fltRateAverage 
					 * @return double
					 */
					return $this->fltRateAverage;

				case 'Comment':
					/**
					 * Gets the value for strComment 
					 * @return string
					 */
					return $this->strComment;

				case 'ReviewDate':
					/**
					 * Gets the value for dttReviewDate 
					 * @return QDateTime
					 */
					return $this->dttReviewDate;

				case 'UpdateDate':
					/**
					 * Gets the value for dttUpdateDate 
					 * @return QDateTime
					 */
					return $this->dttUpdateDate;

				case 'UpdateCount':
					/**
					 * Gets the value for intUpdateCount (Not Null)
					 * @return integer
					 */
					return $this->intUpdateCount;

				case 'Type':
					/**
					 * Gets the value for intType (Not Null)
					 * @return integer
					 */
					return $this->intType;

				case 'Status':
					/**
					 * Gets the value for intStatus (Not Null)
					 * @return integer
					 */
					return $this->intStatus;

				case 'Active':
					/**
					 * Gets the value for strActive (Not Null)
					 * @return string
					 */
					return $this->strActive;


				///////////////////
				// Member Objects
				///////////////////
				case 'Project':
					/**
					 * Gets the value for the TableProject object referenced by intProjectId (Not Null)
					 * @return TableProject
					 */
					try {
						if ((!$this->objProject) && (!is_null($this->intProjectId)))
							$this->objProject = TableProject::Load($this->intProjectId);
						return $this->objProject;
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				////////////////////////////
				// Virtual Object References (Many to Many and Reverse References)
				// (If restored via a "Many-to" expansion)
				////////////////////////////


				case '__Restored':
					return $this->__blnRestored;

				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

				/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'ProjectId':
					/**
					 * Sets the value for intProjectId (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						$this->objProject = null;
						return ($this->intProjectId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'BuyerId':
					/**
					 * Sets the value for intBuyerId (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intBuyerId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ProviderId':
					/**
					 * Sets the value for intProviderId (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intProviderId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate1':
					/**
					 * Sets the value for intRate1 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate1 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate2':
					/**
					 * Sets the value for intRate2 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate2 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate3':
					/**
					 * Sets the value for intRate3 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate3 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate4':
					/**
					 * Sets the value for intRate4 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate4 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate5':
					/**
					 * Sets the value for intRate5 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate5 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Rate6':
					/**
					 * Sets the value for intRate6 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intRate6 = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'RateAverage':
					/**
					 * Sets the value for fltRateAverage 
					 * @param double $mixValue
					 * @return double
					 */
					try {
						return ($this->fltRateAverage = QType::Cast($mixValue, QType::Float));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Comment':
					/**
					 * Sets the value for strComment 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strComment = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ReviewDate':
					/**
					 * Sets the value for dttReviewDate 
					 * @param QDateTime $mixValue
					 * @return QDateTime
					 */
					try {
						return ($this->dttReviewDate = QType::Cast($mixValue, QType::DateTime));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'UpdateDate':
					/**
					 * Sets the value for dttUpdateDate 
					 * @param QDateTime $mixValue
					 * @return QDateTime
					 */
					try {
						return ($this->dttUpdateDate = QType::Cast($mixValue, QType::DateTime));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'UpdateCount':
					/**
					 * Sets the value for intUpdateCount (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intUpdateCount = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Type':
					/**
					 * Sets the value for intType (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intType = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Status':
					/**
					 * Sets the value for intStatus (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intStatus = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Active':
					/**
					 * Sets the value for strActive (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strActive = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				///////////////////
				// Member Objects
				///////////////////
				case 'Project':
					/**
					 * Sets the value for the TableProject object referenced by intProjectId (Not Null)
					 * @param TableProject $mixValue
					 * @return TableProject
					 */
					if (is_null($mixValue)) {
						$this->intProjectId = null;
						$this->objProject = null;
						return null;
					} else {
						// Make sure $mixValue actually is a TableProject object
						try {
							$mixValue = QType::Cast($mixValue, 'TableProject');
						} catch (QInvalidCastException $objExc) {
							$objExc->IncrementOffset();
							throw $objExc;
						} 

						// Make sure $mixValue is a SAVED TableProject object
						if (is_null($mixValue->Id))
							throw new QCallerException('Unable to set an unsaved Project for this TableProjectReviewByBuyer');

						// Update Local Member Variables
						$this->objProject = $mixValue;
						$this->intProjectId = $mixValue->Id;

						// Return $mixValue
						return $mixValue;
					}
					break;

				default:
					try {
						return parent::__set($strName, $mixValue);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Lookup a VirtualAttribute value (if applicable).  Returns NULL if none found.
		 * @param string $strName
		 * @return string
		 */
		public function GetVirtualAttribute($strName) {
			if (array_key_exists($strName, $this->__strVirtualAttributeArray))
				return $this->__strVirtualAttributeArray[$strName];
			return null;
		}



		///////////////////////////////
		// ASSOCIATED OBJECTS' METHODS
		///////////////////////////////





		////////////////////////////////////////
		// METHODS for SOAP-BASED WEB SERVICES
		////////////////////////////////////////

		public static function GetSoapComplexTypeXml() {
			$strToReturn = '<complexType name="TableProjectReviewByBuyer"><sequence>';
			$strToReturn .= '<element name="Id" type="xsd:int"/>';
			$strToReturn .= '<element name="Project" type="xsd1:TableProject"/>';
			$strToReturn .= '<element name="BuyerId" type="xsd:int"/>';
			$strToReturn .= '<element name="ProviderId" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate1" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate2" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate3" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate4" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate5" type="xsd:int"/>';
			$strToReturn .= '<element name="Rate6" type="xsd:int"/>';
			$strToReturn .= '<element name="RateAverage" type="xsd:float"/>';
			$strToReturn .= '<element name="Comment" type="xsd:string"/>';
			$strToReturn .= '<element name="ReviewDate" type="xsd:dateTime"/>';
			$strToReturn .= '<element name="UpdateDate" type="xsd:dateTime"/>';
			$strToReturn .= '<element name="UpdateCount" type="xsd:int"/>';
			$strToReturn .= '<element name="Type" type="xsd:int"/>';
			$strToReturn .= '<element name="Status" type="xsd:int"/>';
			$strToReturn .= '<element name="Active" type="xsd:string"/>';
			$strToReturn .= '<element name="__blnRestored" type="xsd:boolean"/>';
			$strToReturn .= '</sequence></complexType>';
			return $strToReturn;
		}

		public static function AlterSoapComplexTypeArray(&$strComplexTypeArray) {
			if (!array_key_exists('TableProjectReviewByBuyer', $strComplexTypeArray)) {
				$strComplexTypeArray['TableProjectReviewByBuyer'] = TableProjectReviewByBuyer::GetSoapComplexTypeXml();
				TableProject::AlterSoapComplexTypeArray($strComplexTypeArray);
			}
		}

		public static function GetArrayFromSoapArray($objSoapArray) {
			$objArrayToReturn = array();

			foreach ($objSoapArray as $objSoapObject)
				array_push($objArrayToReturn, TableProjectReviewByBuyer::GetObjectFromSoapObject($objSoapObject));

			return $objArrayToReturn;
		}

		public static function GetObjectFromSoapObject($objSoapObject) {
			$objToReturn = new TableProjectReviewByBuyer();
			if (property_exists($objSoapObject, 'Id'))
				$objToReturn->intId = $objSoapObject->Id;
			if ((property_exists($objSoapObject, 'Project')) &&
				($objSoapObject->Project))
				$objToReturn->Project = TableProject::GetObjectFromSoapObject($objSoapObject->Project);
			if (property_exists($objSoapObject, 'BuyerId'))
				$objToReturn->intBuyerId = $objSoapObject->BuyerId;
			if (property_exists($objSoapObject, 'ProviderId'))
				$objToReturn->intProviderId = $objSoapObject->ProviderId;
			if (property_exists($objSoapObject, 'Rate1'))
				$objToReturn->intRate1 = $objSoapObject->Rate1;
			if (property_exists($objSoapObject, 'Rate2'))
				$objToReturn->intRate2 = $objSoapObject->Rate2;
			if (property_exists($objSoapObject, 'Rate3'))
				$objToReturn->intRate3 = $objSoapObject->Rate3;
			if (property_exists($objSoapObject, 'Rate4'))
				$objToReturn->intRate4 = $objSoapObject->Rate4;
			if (property_exists($objSoapObject, 'Rate5'))
				$objToReturn->intRate5 = $objSoapObject->Rate5;
			if (property_exists($objSoapObject, 'Rate6'))
				$objToReturn->intRate6 = $objSoapObject->Rate6;
			if (property_exists($objSoapObject, 'RateAverage'))
				$objToReturn->fltRateAverage = $objSoapObject->RateAverage;
			if (property_exists($objSoapObject, 'Comment'))
				$objToReturn->strComment = $objSoapObject->Comment;
			if (property_exists($objSoapObject, 'ReviewDate'))
				$objToReturn->dttReviewDate = new QDateTime($objSoapObject->ReviewDate);
			if (property_exists($objSoapObject, 'UpdateDate'))
				$objToReturn->dttUpdateDate = new QDateTime($objSoapObject->UpdateDate);
			if (property_exists($objSoapObject, 'UpdateCount'))
				$objToReturn->intUpdateCount = $objSoapObject->UpdateCount;
			if (property_exists($objSoapObject, 'Type'))
				$objToReturn->intType = $objSoapObject->Type;
			if (property_exists($objSoapObject, 'Status'))
				$objToReturn->intStatus = $objSoapObject->Status;
			if (property_exists($objSoapObject, 'Active'))
				$objToReturn->strActive = $objSoapObject->Active;
			if (property_exists($objSoapObject, '__blnRestored'))
				$objToReturn->__blnRestored = $objSoapObject->__blnRestored;
			return $objToReturn;
		}

		public static function GetSoapArrayFromArray($objArray) {
			if (!$objArray)
				return null;

			$objArrayToReturn = array();

			foreach ($objArray as $objObject)
				array_push($objArrayToReturn, TableProjectReviewByBuyer::GetSoapObjectFromObject($objObject, true));

			return unserialize(serialize($objArrayToReturn));
		}

		public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) {
			if ($objObject->objProject)
				$objObject->objProject = TableProject::GetSoapObjectFromObject($objObject->objProject, false);
			else if (!$blnBindRelatedObjects)
				$objObject->intProjectId = null;
			if ($objObject->dttReviewDate)
				$objObject->dttReviewDate = $objObject->dttReviewDate->__toString(QDateTime::FormatSoap);
			if ($objObject->dttUpdateDate)
				$objObject->dttUpdateDate = $objObject->dttUpdateDate->__toString(QDateTime::FormatSoap);
			return $objObject;
		}




	}



	/////////////////////////////////////
	// ADDITIONAL CLASSES for QCubed QUERY
	/////////////////////////////////////

	class QQNodeTableProjectReviewByBuyer extends QQNode {
		protected $strTableName = 'table_project_review_by_buyer';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'TableProjectReviewByBuyer';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'ProjectId':
					return new QQNode('project_id', 'ProjectId', 'integer', $this);
				case 'Project':
					return new QQNodeTableProject('project_id', 'Project', 'integer', $this);
				case 'BuyerId':
					return new QQNode('buyer_id', 'BuyerId', 'integer', $this);
				case 'ProviderId':
					return new QQNode('provider_id', 'ProviderId', 'integer', $this);
				case 'Rate1':
					return new QQNode('rate1', 'Rate1', 'integer', $this);
				case 'Rate2':
					return new QQNode('rate2', 'Rate2', 'integer', $this);
				case 'Rate3':
					return new QQNode('rate3', 'Rate3', 'integer', $this);
				case 'Rate4':
					return new QQNode('rate4', 'Rate4', 'integer', $this);
				case 'Rate5':
					return new QQNode('rate5', 'Rate5', 'integer', $this);
				case 'Rate6':
					return new QQNode('rate6', 'Rate6', 'integer', $this);
				case 'RateAverage':
					return new QQNode('rate_average', 'RateAverage', 'double', $this);
				case 'Comment':
					return new QQNode('comment', 'Comment', 'string', $this);
				case 'ReviewDate':
					return new QQNode('review_date', 'ReviewDate', 'QDateTime', $this);
				case 'UpdateDate':
					return new QQNode('update_date', 'UpdateDate', 'QDateTime', $this);
				case 'UpdateCount':
					return new QQNode('update_count', 'UpdateCount', 'integer', $this);
				case 'Type':
					return new QQNode('type', 'Type', 'integer', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'integer', $this);
				case 'Active':
					return new QQNode('active', 'Active', 'string', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

	class QQReverseReferenceNodeTableProjectReviewByBuyer extends QQReverseReferenceNode {
		protected $strTableName = 'table_project_review_by_buyer';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'TableProjectReviewByBuyer';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'ProjectId':
					return new QQNode('project_id', 'ProjectId', 'integer', $this);
				case 'Project':
					return new QQNodeTableProject('project_id', 'Project', 'integer', $this);
				case 'BuyerId':
					return new QQNode('buyer_id', 'BuyerId', 'integer', $this);
				case 'ProviderId':
					return new QQNode('provider_id', 'ProviderId', 'integer', $this);
				case 'Rate1':
					return new QQNode('rate1', 'Rate1', 'integer', $this);
				case 'Rate2':
					return new QQNode('rate2', 'Rate2', 'integer', $this);
				case 'Rate3':
					return new QQNode('rate3', 'Rate3', 'integer', $this);
				case 'Rate4':
					return new QQNode('rate4', 'Rate4', 'integer', $this);
				case 'Rate5':
					return new QQNode('rate5', 'Rate5', 'integer', $this);
				case 'Rate6':
					return new QQNode('rate6', 'Rate6', 'integer', $this);
				case 'RateAverage':
					return new QQNode('rate_average', 'RateAverage', 'double', $this);
				case 'Comment':
					return new QQNode('comment', 'Comment', 'string', $this);
				case 'ReviewDate':
					return new QQNode('review_date', 'ReviewDate', 'QDateTime', $this);
				case 'UpdateDate':
					return new QQNode('update_date', 'UpdateDate', 'QDateTime', $this);
				case 'UpdateCount':
					return new QQNode('update_count', 'UpdateCount', 'integer', $this);
				case 'Type':
					return new QQNode('type', 'Type', 'integer', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'integer', $this);
				case 'Active':
					return new QQNode('active', 'Active', 'string', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

?>